package operators;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author marcin
 */
import java.util.List;
import java.util.Map;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 *
 * @author marcin
 */
public class MinOperator extends OperatorImpl {

    public MinOperator() {
    }

    @Override
    public Double calculateHappiness(Map<String,Double> map) {
        Double min = 1.0;
        for (Double d : map.values()) {
            if (d < min) {
                min = d;
            }
        }
        System.out.println("Calculating happiness with min operator from the lib...");
        return min;
    }
    @Override
    public void showDialog(JFrame frame, List<String> inputs) {
          JOptionPane.showMessageDialog(null, "No extra parameters needed.\n");
    }
}